package com.hoo.auth;

import java.io.IOException;

import org.apache.ibatis.executor.ErrorContext;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.core.NestedIOException;

public class MybatisErrorCatch extends org.mybatis.spring.SqlSessionFactoryBean {
	public SqlSessionFactory buildSqlSessionFactory (){
		try {
			return super.buildSqlSessionFactory();
		} catch (NestedIOException e) {
			e.printStackTrace(); // XML 有错误时打印异常。
			//throw new NestedIOException("Failed to parse mapping resource: '" + mapperLocation + "'", e);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			ErrorContext.instance().reset();
		}
		return null;
	}

}
